<?xml version="1.0" encoding="UTF-8"?>
<!--
To change this template, choose Tools | Templates
and open the template in the editor.
-->
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<ui:composition xmlns="http://www.w3.org/1999/xhtml"
                xmlns:p="http://primefaces.prime.com.tr/ui"
                xmlns:h="http://java.sun.com/jsf/html"
                xmlns:f="http://java.sun.com/jsf/core"
                xmlns:ui="http://java.sun.com/jsf/facelets"
                xmlns:c="http://java.sun.com/jsp/jstl/core"
                template="./../templates/StakeholderPortalTemplate.xhtml">
    <ui:define name="content">
        <h:form>
            <f:view beforePhase="#{stakeholderPortalManagedBean.initView}">

                <h:form id="sPortalform" enctype="multipart/form-data" prependId="false" style="width: auto; height: auto;">
                    <p:panel header="Manage Portal Information" >

                        <h:panelGrid columns="2" style="width: 400px; height: auto;">
                            <h:outputText value="Welcome #{stakeholderPortalManagedBean.stakeholderAccountState.username}"/>
                            <br/>
                            <h:outputText value="Stakeholder Description *: " />
                            <p:inplace editor="true" onEditUpdate="msgs">  
                                <p:inputText value="#{stakeholderPortalManagedBean.stakeholderAccountState.stakeholderDesc}"  
                                             required="true" label="text" id="sDesc" style="width: 540px; height: 130px"/>  
                            </p:inplace>  
                            <br/>
                            <h:message for="sDesc"></h:message>






                            <h:outputText value="Upload Image: " />
                            <p:fileUpload fileUploadListener="#{mediaUploadManagedBean.handleImageUpload}"
                                          auto="true"
                                          update="imagePreview, msgs" />

                            <h:outputText value="Preview Image: " />
                            <p:graphicImage id="imagePreview" value="#{mediaUploadManagedBean.imageFilePath}" style="width: 550px; height: 270px"/>

                            <p:growl id ="msgs" showDetail="true"></p:growl>
                            <br />
                            <p:commandButton id="saveBtn" disabled="#{stakeholderPortalManagedBean.success}" rendered="#{!stakeholderPortalManagedBean.success}" update="msgs, branchBtn" actionListener="#{stakeholderPortalManagedBean.saveStakeholderPortalInfo}" value="Save" ajax="true">
                            </p:commandButton>

                            <p:commandButton id="branchBtn" disabled="#{!stakeholderPortalManagedBean.success}" actionListener ="#{stakeholderPortalManagedBean.redirectPage}" value="Add Branch" ajax="true"/>

                        </h:panelGrid>
                    </p:panel>
                </h:form>
            </f:view>
    </ui:define>
</ui:composition>
